// JavaScript Document
$(function(){
	var ins=$("input[type='text']");
	$.each(ins,function(i,value){
		$(ins[i]).unbind();
		$(ins[i]).bind({
			focus:function(){
				$(this).css("borderColor","#0080FF");
			},
			blur:function(){
				$(this).css("borderColor","#999");
			}
		});
	});
});

function y_yd() {
	var to=$("#qq").val();
	if(to!=""){
		$.ajax({
		    url: "../json/Mail_sendMail",    //请求的url地址
		    dataType: "json",   //返回格式为json
		    async: true, //请求是否异步，默认为异步，这也是ajax重要特性
		    type: "POST",
		    data:{"to_email":to},
		    success: function(data) {
		    	if(data.result>0){
		    		alert("邮件发送成功!\n窗口将在3秒钟后关闭");
		    	}else{
		    		alert("邮件发送失败!\n窗口将在3秒钟后关闭");
		    	}
		    }
		});
		window.setTimeout("winClose()", 3000);
	}else{
		alert("邮箱不能为空!\n窗口将在3秒钟后关闭");
		window.setTimeout("winClose()", 3000);
	}
	
}

function getQueryString(name){
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

function winClose() {
	window.close();
}